/**
 * spu 相关
 */
import type { attrListModel } from '@/api/product/model/attr'

// 请求spu列表的响应
export interface spuResponse {
  records: spuListModel,
  total: number,
  pages: number
}

// spu Model
export interface spuItemModel {
  id?: number,
  spuName: string,
  description: string,
  category3Id: number,
  tmId: number | undefined, // 品牌id
  spuSaleAttrList: spuSaleAttrListModel, // 属性名列表
  spuImageList: spuImageListModel // 图片列表
}
// spu列表
export type spuListModel = spuItemModel[]

// spu销售属性值
export interface spuSaleAttrValueModel {
  id?: number,
  spuId?: number,
  baseSaleAttrId?: number,
  saleAttrValueName: string,
  saleAttrName?: string,
  isChecked?: boolean | null
}
export type spuSaleAttrValueListModel = spuSaleAttrValueModel[]

// spu 的 销售属性
export interface spuSaleAttrModel {
  id?: number,
  spuId?: number,
  baseSaleAttrId: number,
  saleAttrName: string,
  spuSaleAttrValueList: spuSaleAttrValueListModel,
  inputVisible?: boolean,
}
export type spuSaleAttrListModel = spuSaleAttrModel[]

// spu 基础品牌列表
export interface spuTrademarkModel {
  id: number,
  tmName: string,
  logoUrl: string
}
export type spuTrademarkListModel = spuTrademarkModel[]

// spu图片列表
export interface spuImageModel {
  id?: number,
  spuId?: number,

  imgName: string, //
  imgUrl: string, // 

  spuImgId?: number,

  isDefault?: string,
}
export type spuImageListModel = spuImageModel[]

// 基本销售属性列表
export interface spuBaseSaleAttrModel {
  id: number,
  name: string
}
export type spuBaseSaleAttrListModel = spuBaseSaleAttrModel[]

// 展示的sku的Model
export interface spuItemDetailModel {
  spuId: number,
  category3Id: number, // 设置一个默认值
  skuName: string,
  price: number,
  weight: number,
  skuDesc: string,
  skuAttrList: attrListModel,
  skuSaleAttrList: spuSaleAttrListModel,
  skuImageList: spuImageListModel,
  skuDefaultImg: string,
}

